//
//  AXFSureBuyView.m
//  AIXF
//
//  Created by Macx on 2017/7/13.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "AXFSureBuyView.h"
#import "AXFAccountManager.h"

@interface AXFSureBuyView ()

@property (weak, nonatomic) IBOutlet UILabel *totalPriceLabel;

@property (weak, nonatomic) IBOutlet UIButton *sureBtn;

@end
@implementation AXFSureBuyView

- (IBAction)sureBtnAction:(id)sender
{
    
    [[NSNotificationCenter defaultCenter] postNotificationName:kSureBuyNotification object:self.totalPrice];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self = [[NSBundle mainBundle] loadNibNamed:@"AXFSureBuyView" owner:nil options:nil].firstObject;
    }
    return self;
}

- (void)setTotalPrice:(NSString *)totalPrice
{
    _totalPrice = totalPrice;
    
    _totalPriceLabel.text = [totalPrice isEqualToString:@"0.00"]?@"  购物车还为空,再去逛逛吧":[NSString stringWithFormat:@"  共 $ %@",totalPrice];
    
}

@end
